% ctex-fontset-fandol.def: Fandol 的字体设置，为 Fandol 基金会的四套字体
% vim:ft=tex

\providebool{CTEX@temp}
\booltrue{CTEX@temp}

\ifCTEX@engines{xeCJK}{LuaCJK}{
  \setCJKmainfont[BoldFont=FandolSong-Bold,ItalicFont=FandolKai]{FandolSong-Regular}
  \setCJKsansfont[BoldFont=FandolHei-Bold]{FandolHei-Regular}
  \setCJKmonofont{FandolFang}
  \setCJKfamilyfont{zhsong}[BoldFont=FandolSong-Bold]{FandolSong}
  \setCJKfamilyfont{zhhei} [BoldFont=FandolHei-Bold]{FandolHei}
  \setCJKfamilyfont{zhfs}  {FandolFang}
  \setCJKfamilyfont{zhkai} {FandolKai}
}{
  \ifpdf
    \boolfalse{CTEX@temp}
  \else
    \ifCTEX@engine{zhmCJK}{
      \setCJKmainfont[cmap=UniGB-UTF16-H,BoldFont=FandolSong-Bold.otf,ItalicFont=FandolKai-Regular.otf]{FandolSong-Regular.otf}
      \setCJKsansfont[cmap=UniGB-UTF16-H,BoldFont=FandolHei-Bold.otf]{FandolHei-Regular.otf}
      \setCJKmonofont[cmap=UniGB-UTF16-H]{FandolFang-Regular.otf}
      \setCJKfamilyfont{zhsong}[cmap=UniGB-UTF16-H,BoldFont=FandolSong-Bold.otf]{FandolSong-Regular.otf}
      \setCJKfamilyfont{zhhei}[cmap=UniGB-UTF16-H,BoldFont=FandolHei-Bold.otf]{FandolHei-Regular.otf}
      \setCJKfamilyfont{zhfs}[cmap=UniGB-UTF16-H]{FandolFang-Regular.otf}
      \setCJKfamilyfont{zhkai}[cmap=UniGB-UTF16-H]{FandolKai-Regular.otf}
    }{
      \ifbool{CTEX@zhmap}
        {\CTEX@inputzhmap{zhfandolfonts}}
        {\boolfalse{CTEX@temp}}
    }
  \fi
}

\ifbool{CTEX@temp}{
  \newcommand*\songti  {\CJKfamily{zhsong}}  % 宋体
  \newcommand*\heiti   {\CJKfamily{zhhei}}   % 黑体
  \newcommand*\kaishu  {\CJKfamily{zhkai}}   % 楷书
  \newcommand*\fangsong{\CJKfamily{zhfs}}    % 仿宋
}{}

\endinput
